package com.itstu.service.impl;

import com.itstu.mapper.MessageMapper;
import com.itstu.pojo.Message;
import com.itstu.pojo.dto.MessageDTO;
import com.itstu.service.MessageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author 梁卓
 * @Version 1.0
 * @ClassName MessageServiceImpl
 * @Description TODO
 * @Date 2024/10/09 21:03
 */
@Service
public class MessageServiceImpl implements MessageService {

    @Resource
    private MessageMapper messageMapper;

    /**
     * 获取消息列表
     * @param uid 登录用户信息id
     * @param fid 好友id
     * @return 消息列表
     */
    @Override
    public List<MessageDTO> getMessageList(Long uid, Long fid) {
        return messageMapper.getMessageList(uid, fid);
    }

    /**
     * 发送消息
     * @param message 消息内容
     */
    @Override
    public void sendMessage(Message message) {
        messageMapper.sendMessage(message);
    }
}
